import labmem.SegmentTree.SegmentTree;

public class Main {
    public static void main(String[] args) {

        Integer[] nums = {-2, 0, 3, -5, -1, 2};

        SegmentTree<Integer> segmentTree = new SegmentTree<>(nums, (a, b) -> a + b);

//        SegmentTree<Integer> segmentTree=new SegmentTree<>(nums, new Merger<Integer>() {
//            @Override
//            public Integer merge(Integer a, Integer b) {
//                return a+b;
//            }
//        });

        System.out.println(segmentTree.query(0,5));
    }
}
